package com.dgut.service;

import com.dgut.mapper.GradeMapper;
import com.dgut.pojo.Grade;
import com.dgut.pojo.GradeExample;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service
public class GradeService {
    @Resource
    private GradeMapper gradeMapper;

    @Transactional(propagation = Propagation.REQUIRED,readOnly = true)
    public List<Grade> query() {
        List<Grade> grades = gradeMapper.selectByExample(new GradeExample());
        return  grades;
    }
}
